package xidian.vlab.utils;

import xidian.vlab.dto.UserDTO;

public class TokenUtil {
    public static String createToken(UserDTO user, String role){
        return user.getUid()+","+role ;
    }
    public static UserDTO parseTokenId(String Token){
        UserDTO user = new UserDTO();
        Long uid = Long.parseLong(Token.split(",")[0]);
        user.setUid(uid);
        user.setRole(Token.split(",")[1]);
        return user;
    }
}
